﻿// <copyright file="MockPersistenceModule.cs" company="Ecole Normale Supérieure">
// Released under GPLv2
// </copyright>
// <summary>Contains the MockPersistenceModule</summary>

namespace Sqwarea.Persistence.Mock
{
    using Autofac.Builder;

    /// <summary>
    /// Autofac module for registering Mock Persistence class for Web Role
    /// </summary>
    public class MockPersistenceModule : Module
    {
        /// <summary>
        /// Register Mock Persistence modules.
        /// </summary>
        /// <param name="moduleBuilder">See Autofac documentation.</param>
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            moduleBuilder.Register<MockUserProvider>().As<IUserProvider>().SingletonScoped();
            moduleBuilder.Register<MockGlobalVariables>().As<IGlobalVariables>().SingletonScoped();
            moduleBuilder.Register<MockGameProvider>().As<IGameProvider>().SingletonScoped();
            moduleBuilder.Register<MockLogProvider>().As<ILogProvider>().SingletonScoped();
        }
    }
}
